// 计时器

import React, { useState, useEffect, Suspense } from 'react';

const Timer = () => {
  const [count, setCount] = useState(0);
  
  useEffect(() => {
    setInterval(() => {
      setCount(count => count + 1);
    }, 1000);
  }, []);
  
  return (
    <>
      <Suspense fallback={<div>loading...</div>}>
        <div>count is {count}</div>
      </Suspense>
      <div>count is {count}</div>
    </>
  );
};
export default Timer;